﻿using Microsoft.Practices.Unity;

namespace CNav.Common
{
    public interface IServiceContainer
    {
        T Get<T>();
    }

    public class ServiceContainer : IServiceContainer
    {
        private readonly IUnityContainer _container;

        public ServiceContainer(IUnityContainer container)
        {
            _container = container;
        }

        public T Get<T>()
        {
            return _container.Resolve<T>();
        }
    }
}
